home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
JCSM Shareware Collection 1996 September
/
JCSM Shareware Collection (JCS Distribution) (September 1996).ISO
/
prgtools
/
euphor13.zip
/
ED.DOC
< prev
next >
Wrap
Text File
|
1995-05-15
|
8KB
|
184 lines
+-----------------------+
| The Euphoria Editor |
+-----------------------+
usage: ed filename
ed
Summary
-------
After any error, just type "ed", and you'll be placed in the editor, at the
line and column where the error was detected. The error message will be at
the top of your screen.
.e, .ex and .pro files are displayed in color. Other text files are in mono.
You'll know that you have misspelled something when the color does not change
as you expect. Keywords are blue. Names of routines that are built in to
ex.exe appear in magenta. Strings are brown, comments are red, most other
text is black. Balanced brackets (on the same line) have the same color.
You can change these colors as well as several other parameters of ed. See
"user-modifiable parameters" near the top of ed.ex.
The arrow keys move the cursor left, right, up or down. Most other characters
are immediately inserted into the file. Non-standard keys on the keyboard are
ignored.
In Windows, you can "associate" various types of files with ed.bat. You will
then be put into ed when you double-click on these types of files - e.g.
.e, .pro, .doc etc. Main Euphoria files ending in .ex might better be
associated with "ex.exe".
Ed is a multi-file/multi-window editor. Esc c will split your screen so
you can view and edit up to 10 files simultaneously, with cutting and
pasting between them. You can also use multiple edit windows to view and edit
different parts of a single file.
Special Keys
------------
<delete> Delete the current character above the cursor.
<back-space> Move the cursor to the left and delete a character.
<control-delete>
or Delete the current line. (<control-delete> is not
<control-d> available on all systems.)
<insert> Re-insert the preceding series of deletes or
control-deletes before the current character or
current line.
<home> Move to line 1.
<end> Move to the last line in the file.
<page up> Move up one screen
<page down> Move down one screen
F1 ... F10 Select a new current window. The windows are numbered
from top to bottom, with the top window on the screen
being F1.
Escape Commands
---------------
Press and release the <Esc> key, then press one of the following keys:
h Get help text on the editor, or on Euphoria. This operation
may not work if you are very low on extended memory.
c "Clone" the current window, i.e. make a new edit window that is
initially viewing the same file at the same position as the
current window. The sizes of all windows are adjusted to make room
for the new window. You might want to use Esc l to get more lines
on the screen. Each window that you create can be scrolled
independently and each has its own menu bar. The changes that you
make to a file will initially appear only in the current window.
When you press an F-key to select a new window, any changes will
appear there as well. You can use Esc n to read a new file into
any window.
q Quit (delete) the current window and leave the editor if there are
no more windows. You'll be warned if this is the last window used for
editing a modified file. Any remaining windows are given more space.
s Save the file being edited in the current window, then quit the
current window as q above.
w Save the file but do not quit the window.
e Save the file, and then execute it with ex. When the program finishes
execution you'll hear a beep. Hit Enter to return to the editor.
This operation may not work if you are very low on extended memory.
d Run a DOS command. After the beep, hit Enter to return to the editor.
You can use this command to edit another file and then return.
n Start editing a new file in the current window. Deleted lines/chars
and search strings are available for use in the new file.
f Find the next occurrence of a string in the current window. When
you type in a new string there is an option to "match case" or
not. Press n if you'll accept a match regardless of upper/lower
case. Keep hitting Enter to find subsequent occurrences. Any other
key stops the search. To search from the beginning, press the Home
key before Esc f.
r Globally replace one string by another. Operates like f command.
Keep hitting Enter to continue replacing.
l Change the number of lines displayed on the screen. Only certain
values are allowed, depending on your video card. Many cards will
allow 25, 28, 43 and 50 lines.
ddd Move to line number ddd. e.g. Esc 1023 Enter would move to
line 1023 in the file.
CR Esc <Enter> will tell you the name of the current file, as well as
the line and character position you are on, and whether the file
has been modified since the last save.
Cutting and Pasting
-------------------
When you <control-delete> a series of consecutive lines, or <delete> a
series of consecutive characters, you create a "kill-buffer" containing
what you just deleted. This kill-buffer can be re-inserted by moving the
cursor and then pressing insert.
A new kill-buffer is started, and the old buffer is lost, each time you
move away and start deleting somewhere else. For example, cut a series of
lines with <control-delete>. Then move the cursor to where you want to paste
the lines and press <insert>. If you want to copy the lines, without
destroying the original text, first <control-delete> them, then immediately
press <insert> to re-insert them. Then move somewhere else and press
<insert> to insert them again, as many times as you like. You can also
<delete> a series of individual *characters*, move the cursor, and then paste
the deleted characters somewhere else. Immediately press <insert> after
deleting if you want to copy without removing the original characters.
Once you have a kill-buffer, you can type Esc n to read in a new file, or you
can press an F-key to select a new edit window. You can then insert your kill
buffer.
Use of Tabs
-----------
The standard tab width on MS-DOS is 8 spaces. The editor assumes tab=8 for
most files. However, it is more convenient when editing a program for a
tab to equal the amount of space that you like to indent. Therefore you will
find that tabs are set to 4 when you edit Euphoria files (or .c, or .h
or .bas files). The editor converts from tab=8 to tab=4 when reading your
program file, and converts back to tab=8 when you save the file. Thus your
file remains compatible with the tab=8 world, e.g. MS-DOS PRINT, EDIT, etc.
If you would like to choose a different number of spaces to indent, change
the line at the top of ed.ex that says "constant PROG_INDENT = 4".
Lines longer than 80 characters
-------------------------------
Lines longer than 80 are marked with an inverse video character in the
80th column. Ed will not display past column 80. By deleting the carriage
return at the end of a line, you can combine it with the next line to create
a line longer than 80. You can also break a long line by inserting a
carriage return.
Maximum File Size
-----------------
Like any Euphoria program, ed can use extended memory. It will edit files
that are much larger than what MS-DOS EDIT or Windows Notepad can handle,
especially if it is run under Windows, or with a DOS swap file.
Non-text Files
--------------
ed is designed for editing pure text files, although you can use it to
view other files. As ed reads in a file, it replaces non-printable
characters (less than ASCII 32) with ASCII 254 - small square. If you
try to save a non-text file you will be warned about this. (MS-DOS EDIT
will quietly corrupt a non-text file - do not save!)
Source Code
-----------
The complete source code to this editor is in bin\ed.ex and bin\syncolor.e.
You are welcome to make improvements. There is a section at the top of
ed.ex containing "user-modifiable" configuration parameters that you
may want to adjust. The colors may require adjusting for some operating
environments.